<?php

/**
 * Userranks: 
 * 4 = OWNER
 * 3 = EDITOR
 * 2 = CONTRIBUTOR
 * 1 = REGISTERED
 * 0 = GUEST
 * 
 * @author A.J. Janssen
 */
class User 
{
    public $id;
    public $username;
    public $email;
    public $password;
    public $rank;
    
    public function isOwner()
    {
        return (!empty($this->rank) && $this->rank == 4);
    }
    
    public function isEditor()
    {
        return (!empty($this->rank) && $this->rank >= 3);
    }
    
    public function isContributor()
    {
        return (!empty($this->rank) && $this->rank >= 2);
    }
    
    public function isRegistered()
    {
        return (!empty($this->rank) && $this->rank >= 1);
    }
}

?>
